﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MockPrjTeam2.Biz;
using MockPrjTeam2.Entity;

namespace MockPrjTeam2.Pages.Views
{
    public partial class GovOfficeRegionDetails : System.Web.UI.Page
    {
        private int govOfficeRegionId;
        private GovOfficeRegionBiz biz;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!int.TryParse(Request.Params["id"], out govOfficeRegionId))
            {
                Response.Redirect("../Views/ListGovOfficeRegion.aspx");
            }
            else
            {
                biz = new GovOfficeRegionBiz();

            }
            if (!IsPostBack)
            {
                GetGovOfficeRegionById();

            }
        }


        private void GetGovOfficeRegionById()
        {

            GovOfficeRegion govOfficeRegion = biz.GetById(govOfficeRegionId);
            TxtGovtName.Text = govOfficeRegion.GovtOfficeRegionName;
            TxtDescription.Text = govOfficeRegion.Description;
            TxtCounty.Text = govOfficeRegion.CountyName;

        }
        protected void BtnBackClick(object sender, EventArgs e)
        {
            Response.Redirect("ListGovOfficeRegion.aspx");
        }
    }
}